From 75d1f3cb1635301e715438da91ad9b690d49a670 Mon Sep 17 00:00:00 2001 From: tsteven4 <13596209+tsteven4@users.noreply.github.com> Date: Tue, 25 Apr 2023 14:30:42 -0600 Subject: [PATCH] hide inifile_t from users (#1085) * hide inifile_t from users. * explicitly make vars have internal linkage although since c++11 all vars declared in unnamed namespaces will anyway. --- inifile.cc | 9 +++++++-- inifile.h | 5 +---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/inifile.cc b/inifile.cc index cb0279071..3daa49c8d 100644 --- a/inifile.cc +++ b/inifile.cc @@ -34,6 +34,11 @@ #define MYNAME "inifile" +struct inifile_t { + QHash sections; + QString source; +}; + class InifileSection { public: @@ -46,8 +51,8 @@ public: /* internal procedures */ -#define GPSBABEL_INIFILE "gpsbabel.ini" -#define GPSBABEL_SUBDIR ".gpsbabel" +static constexpr char GPSBABEL_INIFILE[] = "gpsbabel.ini"; +static constexpr char GPSBABEL_SUBDIR[] = ".gpsbabel"; static QString diff --git a/inifile.h b/inifile.h index ef42c0876..4444ee184 100644 --- a/inifile.h +++ b/inifile.h @@ -25,10 +25,7 @@ #include // for QString class InifileSection; -struct inifile_t { - QHash sections; - QString source; -}; +struct inifile_t; // forward declare, opaque to users. /* inifile_init: -- 2.30.2